package spill;

public class HighscoreItem implements Comparable<HighscoreItem> {
	private String name;
	private long score;
	
	public HighscoreItem(String name, long score) {
		if (name != null) {
			this.name = name;
		} else {
			this.name = "Ukjent";
		}
		this.score = score;
	}
	@Override
	public int compareTo(HighscoreItem item) {
		if (score > item.getScore()) {
			return - 1;
		} else if (score == item.getScore()) {
			return 0;
		}
		else {
			return 1;
		}
	}
	
	public long getScore() {
		return score;
	}
	public String getName() {
		return name;
	}
}
